package com.pay.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "9021000131697465";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCJptyR6cby8gRwkfw/t47B5RRjHVICw7C0h7/wEIcJ6D41ISLONbLmXyPickqpaYFNVCwz5tQ8qxlPdWlZCEsA0C6ufQNpv11AfBNOQRSPaZXVIuUiqSpZQeORPirtMfjNMvRFlb1U2R11enZBt7SnsVMn9CWYz889Hy2DCOKZDEeK1PJBPukvH132jCOdbgAfRwQVTjLJ3FTsZxuA5XIEDmzJNPEuub8m75+BLa0vLHYwmbZS3BZpmX/7+Na7nkW6EQR7r4fVWuwrfIx/QT7Dlo4m58CjvPvXt/UYLch8Ww+NKrns9Aq3Fp1zcq/kdg4MzrWoT5SXu3v1DtaidyoLAgMBAAECggEAXv/oDlPXWGgrJD28Z4UZYzvkfBsKNJo15AIkN1xQtkewVx6NVN++njtfGrNiT9Vexa2n7BIMu+ohx7Lyh92vVdpXvVjN+Dd39j8rW8CSnf9yxuwUU32Imp1cnyrWmWj5mzTlXPjg+CP3rtJbtzM/3NQG3fYj1HjnP/m6gUqqiJDrzNbil+RCHwQNmD4d/h7KpP8hWwQRiRe3Dl7BnuRc+i8vD6Dv5GSnzBmFyI69d4IEyN9imXcqRyft0n34sdwn+eKlqB3RN/iesgbeewJhHLO/5Y2WY81phoaOKPxke45lwL59IbQMRJM0eJk3R75YnNy1TPgRLcxgEbFVFoHIIQKBgQC/kItwyrFYdUwEfUhIR/3HaiRRAIkEBvmBh1pXYsmhhiPUpmmUPaszbu651m1u9JD10+6EQfqvVMkq7AGxkCWdIbe7Bgp7ZLrPrENGodMhacWfAld7hPc0qkOGdf40TGYtn/QCgQfgtup0ogFd33f6YTyxQsitK5fzqEik1HA24wKBgQC38+7KhHi/eE4N0ixgv71CtEmu7+1am6qwfrOtqS9uvcKDxEuzH7ywuwqFDQ++JIOL+4UsyToKAdFbWpZl//yX2kuMEq15cM62LxHgcGz+SGmdJTBm5BdaaoZ7yjXAUAsnGJ/Ps6OMBC7HnXaeaYbdX343u/gufVj8X70LK7qAuQKBgF2h6BYkbJShGJvlJIx367opzkBtc4stYY0HPIgT+BvkNeU9xcM4dVK5eSQKhAjEr4oIob+xhDdoyL8bBiTlIQ1xqp1WcY8oiArz1xpSBKGDUp3LBjmQn0f1pPW2/J5RbWwFj74dlV0n6udBPEvG65zNJF48F1xVP3tQGNnAIG0jAoGBAIUal5WoZyq8ZVYw1vWmp86lX4+agheG/eo5s8+b1Pt/iUkI93GELGeA36rIebSu/RSECagPbtSg3hkJIjxqDx7d0L5pIWb3DkvbIUdScjtIsEsKBszcjF1bKTZXaa9e+8LtWW3T4SpGOIct1A/p8bErEMxJUdppzsLGj6aOnKPZAoGAMZYb3sv/SIMinGwaibHtRiZ2yXwUa8VO/TrKcLdWCyvLJGwma1Wc3675zydTQlqkVyXU5EcDCp2v+ANNPMyljbIPuDOoRcofp1CJegtgiyiJr/OOnczyMs7D+kvUxtN79gXGAqY11QaK1/drnQj8tRyBv/rM/TjCX5ytJZGjTB4=";
	
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlFzxBEGCuDaPHKsz0wymWGXQrKQrt0RFtjcOV5nhFOiXZs8kG6jtA0GhPnVYq4ET9jHO1xdAC4FPB71U3rgFf7rFd+gCViIjLGyH4NnvCxs+Lk4HTDBAkGmg4t6Ow4GXonahQ0Ac5Vmz1Hn7C4YiKH17k4+vP1EoGeu3YOmbHfVEsEAit3aC3Q9RVVY5HQe50BgcOQZU7yBLf3Z1q+pfdbtrGo6axrN6f7lIjT94Pv2tAiVSdSSCPZTmC+tVY9rPFkLpawkJuCQaYbvlBQZ/q7qWlbWtYqRvs0OkjfpDrEpn3ARyB2v4N9whYlQ+kgmUtxEf2JPcVH9pnPkLoAu3OQIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://localhost:8080/pay/page/notify";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://localhost:8080/pay/page/return";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi-sandbox.dl.alipaydev.com/gateway.do";
	
	// 日志路径
	public static String log_path = "d:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑


    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

